/**
 * 函数式组件
 * 注意点
 *  函数名大写字母开头
 *  函数必须有返回值
 */
import React from "react";

export  function MyComponent() {
    return <h1>函数式组件</h1>
}

class  Person extends React.Component<any, any>{
    private name?: string;
    constructor(name: string ) {
        super(name);
        this.name = name
    }
    speak(){
        console.log('谁在说话？是：')
    }
}
let person = new Person('张三');
person.speak()
